// controller/hello.go
package controller

import (
    "github.com/gin-gonic/gin"
    "net/http"
)

// HelloHandler 处理 /hello 路由
func HelloHandler(c *gin.Context) {
    // 获取 name 参数，默认为 "World"
    name := c.DefaultQuery("name", "World")

    // 返回 JSON 响应
    c.JSON(http.StatusOK, gin.H{
        "message": "Hello, " + name + "!",
    })
}
